import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children: [{
        path: "/find_music",
        name: "Find_music",
        alias: "",
        component: () => import('../views/Find_music.vue')
      },
      {
        path: "/video",
        name: "Video",
        component: () => import('../views/Video.vue')
      },
      // 朋友的路由
      // {
      //   path: "/friends",
      //   name: "Friends",
      //   component: () => import('../views/Friends.vue')
      // },
      // 歌词的路由
      {
        path: "/lyrics",
        name: "Lyrics",
        component: () => import('../views/Lyrics.vue')
      },
      // 点击选择电台分类的详情路由
      {
        path: "/selectAnchorType",
        name: "SelectAnchorType",
       
        component: () => import('../views/SelectAnchorType.vue')
      },
      // 选择电台的之后的详情路由
      {
        path: "/selectAcchor",
        name: "SelectAcchor",
        component: () => import('../views/SelectAcchor.vue')
      },
      // 选择歌单之后的详情路由
      {
        path: "/songdetails",
        name: "Songdetails",
        component: () => import('../views/Songdetails.vue')
      },
      // 歌手的详情路由
      {
        path: "/singerDetails",
        name: "SingerDetails",
        component: () => import('../views/SingerDetails.vue')
      },
      // 专辑详情
      {
        path: "/zjdetails",
        name: "Zjdetails",
        component: () => import('../views/Zjdetails.vue')
      },
      // 我是搜索 页面
      {
        path: "/search_music",
        name: "Search_music",
        component: () => import('../views/Search_music.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

// router.beforeEach((to, from, next) => {
//   // ...
//   console.log("to",to);
//   console.log("form",from);
//   next()
// })

export default router